<%
if Request.Cookies("u")("mail")="" and Request.Cookies("u")("Password")="" then
   session("returnurl")=Request.ServerVariables("HTTP_X_REWRITE_URL")
   response.Write("<script>window.location.href='/login?returnurl="&session("returnurl")&"';</script>")
   response.End()
else
set rsuser=server.CreateObject("adodb.recordset")
sql="select * from [user] where mail='"&checkstr(inHTML(Request.Cookies("u")("mail")))&"' "
rsuser.open sql,conn,1,3
if rsuser.eof and rsuser.bof then
Response.Cookies("u")("mail") = ""
Response.Cookies("u")("name") = ""
Response.Cookies("u")("Password") = ""
Response.Cookies("u")("uid") = ""
   session("returnurl")=Request.ServerVariables("HTTP_X_REWRITE_URL")
   response.Write("<script>window.location.href='/login?returnurl="&session("returnurl")&"';</script>")
   response.End
else
if Request.cookies("u")("Password") <> rsuser("password") then
Response.Cookies("u")("mail") = ""
Response.Cookies("u")("name") = ""
Response.Cookies("u")("Password") = ""
Response.Cookies("u")("uid") = ""
   session("returnurl")=Request.ServerVariables("HTTP_X_REWRITE_URL")
   response.Write("<script>window.location.href='/login?returnurl="&session("returnurl")&"';</script>")
   response.End()
   end if
uid=rsuser("uid") 
GradeID=rsuser("GradeID")
username=rsuser("username")  
mail=rsuser("mail")  
mobile=rsuser("mobile") 
sex=rsuser("sex")
name=rsuser("name")
Birth=rsuser("Birth")
qq=rsuser("qq")
key=rsuser("key")
key2=rsuser("key2")
key3=rsuser("key3")
GradeID=rsuser("GradeID")

if key<>"" then response.cookies("key")("key")=request.cookies("key")("key")+"<dd>"&key&"</dd>"
if key2<>"" then response.cookies("key")("key")=request.cookies("key")("key")+"<dd>"&key2&"</dd>"
if key3<>"" then response.cookies("key")("key")=request.cookies("key")("key")+"<dd>"&key3&"</dd>"
ctime=5256000
ctime=dateadd("n",ctime,now())
response.cookies("key").expires=ctime

wangwang=rsuser("wangwang")
Yservice=rsuser("Yservice")
AService=rsuser("AService")
Tservice=rsuser("Tservice")
money=rsuser("money") 
Point=rsuser("Point")
CreditMargin=rsuser("CreditMargin") 
  '会员级别
  set rss=conn.execute("select title from [usertype] where id="&GradeID&"")
  usertype=rss("title")
  set rss=nothing
end if
end if
%>